package com.majiang.majiang.domain;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

/**
 *
 * @author Administrator
 *  一切麻将类的父类
 */
@Setter
@Getter
@ToString
public class MaJiang{
    /**
     * 类型：万、条、筒： 1  2  3
     *      东、南、西、北、中、发、白：4、5、6、7、8、9、10
     */
    private int type;

    private Player player;

    private int code;

    @Override
    public boolean equals(Object obj) {
        return this.type == ((MaJiang) obj).type && this.code == ((MaJiang) obj).code;
     }

    @Override
    public int hashCode() {
        int result = type;
        result = 31 * result + (player != null ? player.hashCode() : 0);
        result = 31 * result + code;
        return result;
    }
}
